<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="core.UserService" %>
<% String R = request.getContextPath(); %>
<div class="container">
   <% if (UserService.isCurrentUserLoggedIn(session) == false) { %>
      <div class="navbar">
         <div class="navbar-inner">
            <div class="container">
               <a class="brand" href="<%=R%>/03_login/index.jsp">성공회대학교</a>
               <div class="nav-collapse collapse">
                  <ul class="nav pull-right">
                     <li><a href="<%=R%>/03_login/login.jsp">로그인</a></li>
                     <li><a href="<%=R%>/03_login/reset.jsp">비밀번호찾기</a></li>
                     <li><a href="<%=R%>/03_login/register.jsp">회원가입</a></li>
                  </ul>
               </div>
            </div>
         </div>
      </div>
   <% } else { %>
      <div class="navbar">
         <div class="navbar-inner">
            <div class="container">
               <a class="brand" href="<%=R%>/03_login/index.jsp">성공회대학교</a>
               <div class="nav-collapse collapse">
                  <ul class="nav">
                     <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown">게시판<b class="caret"></b></a>
                        <ul class="dropdown-menu">
                           <li><a href="<%=R%>/04_bbs/articleList.jsp?bid=1">공지사항</a></li>
                           <li><a href="<%=R%>/03_login/adminOnly.jsp">관리자 전용</a></li>
                           <li><a href="<%=R%>/03_login/professorOnly.jsp">교수 전용</a></li>
                        </ul>
                     </li>
                     <% if (UserService.isCurrentUserInGroup(session, "관리자")) { %>
                        <li class="dropdown">
                           <a class="dropdown-toggle" data-toggle="dropdown">시스템관리<b class="caret"></b></a>
                           <ul class="dropdown-menu">
                              <li><a href="<%=R%>/02_user/userList.jsp">사용자 관리</a></li>
                              <li><a href="<%=R%>/02_user/usergroupList.jsp">사용자그룹 관리</a></li>
                              <li><a href="<%=R%>/01_log/logList.jsp">로그기록</a></li>
                           </ul>
                        </li>
                     <% } %>
                  </ul>
                  <ul class="nav pull-right">
                     <li><a href="<%=R%>/03_login/mypage.jsp">
                         <%= UserService.getCurrentUserName(session) %> 정보수정</a></li>
                     <li><a href="<%=R%>/03_login/logout.jsp">로그아웃</a></li>
                  </ul>
               </div>
            </div>
         </div>
      </div>
   <% } %>
</div>